$(function () {
    $('#keep').click(function () {
        var old_password = $('#password1').val();
        var new_password = $('#password2').val();
        var params={
            'old_password':old_password,
            'new_password':new_password
        };
        $.ajax({
            url: '/password/',
            type: 'post',
            contentType: 'application/json',
            data: JSON.stringify(params),
            success: function (data) {
                if (data.code = '0') {
                    alert('修改成功');
                    window.location.href = '/login'
                } else {
                    alert('修改失败')
                }
            }

        })
    })
})